<%@ include file="/WEB-INF/jsp/include/head.jsp" %><%@ page language="java" pageEncoding="UTF-8"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <%@ include file="/WEB-INF/jsp/include/title.jsp" %>
    <%@ include file="/WEB-INF/jsp/include/common_css.jsp" %>
    <link rel="stylesheet" type="text/css" media="screen" href="<c:url value="/css/skin/${bbsType.bbsSkin}/default.css"/>"/>
    <%@ include file="/WEB-INF/jsp/include/common_script.jsp" %>
    <script type="text/javascript" src="<c:url value="/js/editor/editor.js"/>"></script>
    <script type="text/javascript">
    //<![CDATA[
    <%@ include file="/js/bbs/bbs.js" %>

	function printPage(bbsNo) {
		window.open("<c:url value='/bbs/print.do?bbsNo=" + bbsNo + "&command=PRINT'/>", '_print');
	}

    $(document).ready(function() {
        if("${param.command}" == "PRINT")
            window.print();
    });

    $(window).load(function () {
        $("#content").editor({
            id : "content",
            isLoad : false,
            scriptUrl : "test.js",
            plugins : "empty",
            buttons : "bold,italic"
        });
    });
    //]]>
    </script>
</head>
<body>
<c:if test="${param.command != 'PRINT'}">
<%@ include file="/WEB-INF/jsp/include/top.jsp" %>
</c:if>
    <form:form id="frmBbs" method="post" commandName="bbsHistory" modelAttribute="bbsHistory">
    <form:hidden path="sid" />
    <form:hidden path="bbsNo" />
    <form:hidden path="bbsId" />
    <input type="hidden" id="command" name="command" />
    <div id="pw_content">
    <c:choose>
    <c:when test="${bbsType.bbsType == 'A00101'}">
        <jsp:include page="./skin/${bbsType.bbsSkin}/list/view.jsp" />
    </c:when>
    <c:when test="${bbsType.bbsType == 'A00102'}">
        <jsp:include page="./skin/${bbsType.bbsSkin}/image/view.jsp" />
    </c:when>
    <c:when test="${bbsType.bbsType == 'A00103'}">
        <jsp:include page="./skin/${bbsType.bbsSkin}/guestbook/view.jsp" />
    </c:when>
    <c:when test="${bbsType.bbsType == 'A00104'}">
        <jsp:include page="./skin/${bbsType.bbsSkin}/forum/view.jsp" />
    </c:when>
    <c:when test="${bbsType.bbsType == 'A00105'}">
        <jsp:include page="./skin/${bbsType.bbsSkin}/wiki/historyView.jsp" />
    </c:when>
    <c:otherwise>
        <jsp:include page="./skin/${bbsType.bbsSkin}/list/view.jsp" />
    </c:otherwise>
    </c:choose>
    </div>
    </form:form>
<c:if test="${param.command != 'PRINT'}">    
<%@ include file="/WEB-INF/jsp/include/footer.jsp" %>
</c:if>
</body>
</html>